<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=9"/>
<meta name="generator" content="Doxygen 1.8.5"/>
<title>RT-Thread RTOS: File POSIX API</title>
<link href="tabs.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript" src="dynsections.js"></script>
<link href="navtree.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="resize.js"></script>
<script type="text/javascript" src="navtree.js"></script>
<script type="text/javascript">
  $(document).ready(initResizable);
  $(window).load(resizeHeight);
</script>
<link href="search/search.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="search/search.js"></script>
<script type="text/javascript">
  $(document).ready(function() { searchBox.OnSelectItem(0); });
</script>
<link href="doxygen.css" rel="stylesheet" type="text/css" />
</head>
<body>
<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
<div id="titlearea">
<table cellspacing="0" cellpadding="0">
 <tbody>
 <tr style="height: 56px;">
  <td style="padding-left: 0.5em;">
   <div id="projectname">RT-Thread RTOS
   &#160;<span id="projectnumber">1.2.0</span>
   </div>
   <div id="projectbrief">An open source embedded real-time operating system</div>
  </td>
 </tr>
 </tbody>
</table>
</div>
<!-- end header part -->
<!-- Generated by Doxygen 1.8.5 -->
<script type="text/javascript">
var searchBox = new SearchBox("searchBox", "search",false,'Search');
</script>
  <div id="navrow1" class="tabs">
    <ul class="tablist">
      <li><a href="index.html"><span>Main&#160;Page</span></a></li>
      <li><a href="pages.html"><span>Related&#160;Pages</span></a></li>
      <li><a href="modules.html"><span>Modules</span></a></li>
      <li><a href="annotated.html"><span>Data&#160;Structures</span></a></li>
      <li>
        <div id="MSearchBox" class="MSearchBoxInactive">
        <span class="left">
          <img id="MSearchSelect" src="search/mag_sel.png"
               onmouseover="return searchBox.OnSearchSelectShow()"
               onmouseout="return searchBox.OnSearchSelectHide()"
               alt=""/>
          <input type="text" id="MSearchField" value="Search" accesskey="S"
               onfocus="searchBox.OnSearchFieldFocus(true)" 
               onblur="searchBox.OnSearchFieldFocus(false)" 
               onkeyup="searchBox.OnSearchFieldChange(event)"/>
          </span><span class="right">
            <a id="MSearchClose" href="javascript:searchBox.CloseResultsWindow()"><img id="MSearchCloseImg" border="0" src="search/close.png" alt=""/></a>
          </span>
        </div>
      </li>
    </ul>
  </div>
</div><!-- top -->
<div id="side-nav" class="ui-resizable side-nav-resizable">
  <div id="nav-tree">
    <div id="nav-tree-contents">
      <div id="nav-sync" class="sync"></div>
    </div>
  </div>
  <div id="splitbar" style="-moz-user-select:none;" 
       class="ui-resizable-handle">
  </div>
</div>
<script type="text/javascript">
$(document).ready(function(){initNavTree('group___fs_posix_api.html','');});
</script>
<div id="doc-content">
<!-- window showing the filter options -->
<div id="MSearchSelectWindow"
     onmouseover="return searchBox.OnSearchSelectShow()"
     onmouseout="return searchBox.OnSearchSelectHide()"
     onkeydown="return searchBox.OnSearchSelectKey(event)">
<a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(0)"><span class="SelectionMark">&#160;</span>All</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(1)"><span class="SelectionMark">&#160;</span>Data Structures</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(2)"><span class="SelectionMark">&#160;</span>Functions</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(3)"><span class="SelectionMark">&#160;</span>Variables</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(4)"><span class="SelectionMark">&#160;</span>Typedefs</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(5)"><span class="SelectionMark">&#160;</span>Enumerations</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(6)"><span class="SelectionMark">&#160;</span>Enumerator</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(7)"><span class="SelectionMark">&#160;</span>Groups</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(8)"><span class="SelectionMark">&#160;</span>Pages</a></div>

<!-- iframe showing the search results (closed by default) -->
<div id="MSearchResultsWindow">
<iframe src="javascript:void(0)" frameborder="0" 
        name="MSearchResults" id="MSearchResults">
</iframe>
</div>

<div class="header">
  <div class="summary">
<a href="#func-members">Functions</a>  </div>
  <div class="headertitle">
<div class="title">File POSIX API<div class="ingroups"><a class="el" href="group___d_f_s.html">Device Virtual File System</a></div></div>  </div>
</div><!--header-->
<div class="contents">
<table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="func-members"></a>
Functions</h2></td></tr>
<tr class="memitem:gad48be43140602f16c8490e82f7bbe0b2"><td class="memItemLeft" align="right" valign="top">int&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group___fs_posix_api.html#gad48be43140602f16c8490e82f7bbe0b2">open</a> (const char *file, int flags, int mode)</td></tr>
<tr class="separator:gad48be43140602f16c8490e82f7bbe0b2"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:gaafbcde67669a1b96577e735ddebd8634"><td class="memItemLeft" align="right" valign="top">int&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group___fs_posix_api.html#gaafbcde67669a1b96577e735ddebd8634">close</a> (int fd)</td></tr>
<tr class="separator:gaafbcde67669a1b96577e735ddebd8634"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:gac327608bc25b32fe6b55aaa0d4bb3f44"><td class="memItemLeft" align="right" valign="top">int&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group___fs_posix_api.html#gac327608bc25b32fe6b55aaa0d4bb3f44">read</a> (int fd, void *buf, size_t len)</td></tr>
<tr class="separator:gac327608bc25b32fe6b55aaa0d4bb3f44"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ga6556217b4010a1fa24d4171625cba2f7"><td class="memItemLeft" align="right" valign="top">int&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group___fs_posix_api.html#ga6556217b4010a1fa24d4171625cba2f7">write</a> (int fd, const void *buf, size_t len)</td></tr>
<tr class="separator:ga6556217b4010a1fa24d4171625cba2f7"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ga8bd74caed008a66808d92d57fa74d9f6"><td class="memItemLeft" align="right" valign="top">off_t&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group___fs_posix_api.html#ga8bd74caed008a66808d92d57fa74d9f6">lseek</a> (int fd, off_t offset, int whence)</td></tr>
<tr class="separator:ga8bd74caed008a66808d92d57fa74d9f6"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ga2ce7c2db9fdb6aec06afaf3cfc5979c7"><td class="memItemLeft" align="right" valign="top">int&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group___fs_posix_api.html#ga2ce7c2db9fdb6aec06afaf3cfc5979c7">rename</a> (const char *old, const char *new)</td></tr>
<tr class="separator:ga2ce7c2db9fdb6aec06afaf3cfc5979c7"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:gaf3cee068f32a919cdd638e0578c1e5f8"><td class="memItemLeft" align="right" valign="top">int&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group___fs_posix_api.html#gaf3cee068f32a919cdd638e0578c1e5f8">unlink</a> (const char *pathname)</td></tr>
<tr class="separator:gaf3cee068f32a919cdd638e0578c1e5f8"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:gac21b705a5ebd42c4c46363250ab817bc"><td class="memItemLeft" align="right" valign="top">int&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group___fs_posix_api.html#gac21b705a5ebd42c4c46363250ab817bc">stat</a> (const char *file, struct stat *buf)</td></tr>
<tr class="separator:gac21b705a5ebd42c4c46363250ab817bc"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:gac1759a877da2f37512096f3a491e4112"><td class="memItemLeft" align="right" valign="top">int&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group___fs_posix_api.html#gac1759a877da2f37512096f3a491e4112">fstat</a> (int fildes, struct <a class="el" href="group___fs_posix_api.html#gac21b705a5ebd42c4c46363250ab817bc">stat</a> *buf)</td></tr>
<tr class="separator:gac1759a877da2f37512096f3a491e4112"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:gae7af18cc5fa39f42a3be1bf1eb24119d"><td class="memItemLeft" align="right" valign="top">int&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group___fs_posix_api.html#gae7af18cc5fa39f42a3be1bf1eb24119d">statfs</a> (const char *path, struct statfs *buf)</td></tr>
<tr class="separator:gae7af18cc5fa39f42a3be1bf1eb24119d"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ga548e5b744ca2e97beb61ad7aa41114e2"><td class="memItemLeft" align="right" valign="top">int&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group___fs_posix_api.html#ga548e5b744ca2e97beb61ad7aa41114e2">mkdir</a> (const char *path, mode_t mode)</td></tr>
<tr class="separator:ga548e5b744ca2e97beb61ad7aa41114e2"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ga570282ae7ba596263ec812b368d99b34"><td class="memItemLeft" align="right" valign="top">int&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group___fs_posix_api.html#ga570282ae7ba596263ec812b368d99b34">rmdir</a> (const char *pathname)</td></tr>
<tr class="separator:ga570282ae7ba596263ec812b368d99b34"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ga1632d8c06c14f295c6d9407b7fec67af"><td class="memItemLeft" align="right" valign="top">DIR *&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group___fs_posix_api.html#ga1632d8c06c14f295c6d9407b7fec67af">opendir</a> (const char *name)</td></tr>
<tr class="separator:ga1632d8c06c14f295c6d9407b7fec67af"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:gaa7687571d2af8efd5153874ae6e678d9"><td class="memItemLeft" align="right" valign="top">struct dirent *&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group___fs_posix_api.html#gaa7687571d2af8efd5153874ae6e678d9">readdir</a> (DIR *d)</td></tr>
<tr class="separator:gaa7687571d2af8efd5153874ae6e678d9"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:gaaf08168ca632ba3f9385aa53261ae63d"><td class="memItemLeft" align="right" valign="top">long&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group___fs_posix_api.html#gaaf08168ca632ba3f9385aa53261ae63d">telldir</a> (DIR *d)</td></tr>
<tr class="separator:gaaf08168ca632ba3f9385aa53261ae63d"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ga58829cca160034015b3dddc17bb502ab"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group___fs_posix_api.html#ga58829cca160034015b3dddc17bb502ab">seekdir</a> (DIR *d, off_t offset)</td></tr>
<tr class="separator:ga58829cca160034015b3dddc17bb502ab"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ga08e6a89050229d246d07d9e17d57cb29"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group___fs_posix_api.html#ga08e6a89050229d246d07d9e17d57cb29">rewinddir</a> (DIR *d)</td></tr>
<tr class="separator:ga08e6a89050229d246d07d9e17d57cb29"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ga058e669d865116ec6419ea3a52207830"><td class="memItemLeft" align="right" valign="top">int&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group___fs_posix_api.html#ga058e669d865116ec6419ea3a52207830">closedir</a> (DIR *d)</td></tr>
<tr class="separator:ga058e669d865116ec6419ea3a52207830"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ga3284211bd28346254245c9d4fd071d7f"><td class="memItemLeft" align="right" valign="top">char *&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group___fs_posix_api.html#ga3284211bd28346254245c9d4fd071d7f">getcwd</a> (char *buf, size_t size)</td></tr>
<tr class="separator:ga3284211bd28346254245c9d4fd071d7f"><td class="memSeparator" colspan="2">&#160;</td></tr>
</table>
<a name="details" id="details"></a><h2 class="groupheader">Detailed Description</h2>
<h2 class="groupheader">Function Documentation</h2>
<a class="anchor" id="gad48be43140602f16c8490e82f7bbe0b2"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">int open </td>
          <td>(</td>
          <td class="paramtype">const char *&#160;</td>
          <td class="paramname"><em>file</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">int&#160;</td>
          <td class="paramname"><em>flags</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">int&#160;</td>
          <td class="paramname"><em>mode</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">
<p>this function is a POSIX compliant version, which will open a file and return a file descriptor.</p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">file</td><td>the path name of file. </td></tr>
    <tr><td class="paramname">flags</td><td>the file open flags. </td></tr>
    <tr><td class="paramname">mode</td><td></td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>the non-negative integer on successful open, others for failed. </dd></dl>

</div>
</div>
<a class="anchor" id="gaafbcde67669a1b96577e735ddebd8634"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">int close </td>
          <td>(</td>
          <td class="paramtype">int&#160;</td>
          <td class="paramname"><em>fd</em></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div><div class="memdoc">
<p>this function is a POSIX compliant version, which will close the open file descriptor.</p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">fd</td><td>the file descriptor.</td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>0 on successful, -1 on failed. </dd></dl>

</div>
</div>
<a class="anchor" id="gac327608bc25b32fe6b55aaa0d4bb3f44"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">int read </td>
          <td>(</td>
          <td class="paramtype">int&#160;</td>
          <td class="paramname"><em>fd</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">void *&#160;</td>
          <td class="paramname"><em>buf</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">size_t&#160;</td>
          <td class="paramname"><em>len</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">
<p>this function is a POSIX compliant version, which will read specified data buffer length for an open file descriptor.</p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">fd</td><td>the file descriptor. </td></tr>
    <tr><td class="paramname">buf</td><td>the buffer to save the read data. </td></tr>
    <tr><td class="paramname">len</td><td>the maximal length of data buffer</td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>the actual read data buffer length </dd></dl>

</div>
</div>
<a class="anchor" id="ga6556217b4010a1fa24d4171625cba2f7"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">int write </td>
          <td>(</td>
          <td class="paramtype">int&#160;</td>
          <td class="paramname"><em>fd</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">const void *&#160;</td>
          <td class="paramname"><em>buf</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">size_t&#160;</td>
          <td class="paramname"><em>len</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">
<p>this function is a POSIX compliant version, which will write specified data buffer length for an open file descriptor.</p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">fd</td><td>the file descriptor </td></tr>
    <tr><td class="paramname">buf</td><td>the data buffer to be written. </td></tr>
    <tr><td class="paramname">len</td><td>the data buffer length.</td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>the actual written data buffer length. </dd></dl>

</div>
</div>
<a class="anchor" id="ga8bd74caed008a66808d92d57fa74d9f6"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">off_t lseek </td>
          <td>(</td>
          <td class="paramtype">int&#160;</td>
          <td class="paramname"><em>fd</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">off_t&#160;</td>
          <td class="paramname"><em>offset</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">int&#160;</td>
          <td class="paramname"><em>whence</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">
<p>this function is a POSIX compliant version, which will seek the offset for an open file descriptor.</p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">fd</td><td>the file descriptor. </td></tr>
    <tr><td class="paramname">offset</td><td>the offset to be seeked. </td></tr>
    <tr><td class="paramname">whence</td><td>the directory of seek.</td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>the current file position, or -1 on failed. </dd></dl>

</div>
</div>
<a class="anchor" id="ga2ce7c2db9fdb6aec06afaf3cfc5979c7"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">int rename </td>
          <td>(</td>
          <td class="paramtype">const char *&#160;</td>
          <td class="paramname"><em>old</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">const char *&#160;</td>
          <td class="paramname"><em>new</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">
<p>this function is a POSIX compliant version, which will rename old file name to new file name.</p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">old</td><td>the old file name. </td></tr>
    <tr><td class="paramname">new</td><td>the new file name.</td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>0 on successful, -1 on failed.</dd></dl>
<p>note: the old and new file name must be belong to a same file system. </p>

</div>
</div>
<a class="anchor" id="gaf3cee068f32a919cdd638e0578c1e5f8"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">int unlink </td>
          <td>(</td>
          <td class="paramtype">const char *&#160;</td>
          <td class="paramname"><em>pathname</em></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div><div class="memdoc">
<p>this function is a POSIX compliant version, which will unlink (remove) a specified path file from file system.</p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">pathname</td><td>the specified path name to be unlinked.</td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>0 on successful, -1 on failed. </dd></dl>

</div>
</div>
<a class="anchor" id="gac21b705a5ebd42c4c46363250ab817bc"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">int stat </td>
          <td>(</td>
          <td class="paramtype">const char *&#160;</td>
          <td class="paramname"><em>file</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">struct stat *&#160;</td>
          <td class="paramname"><em>buf</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">
<p>this function is a POSIX compliant version, which will get file information.</p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">file</td><td>the file name </td></tr>
    <tr><td class="paramname">buf</td><td>the data buffer to save stat description.</td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>0 on successful, -1 on failed. </dd></dl>

</div>
</div>
<a class="anchor" id="gac1759a877da2f37512096f3a491e4112"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">int fstat </td>
          <td>(</td>
          <td class="paramtype">int&#160;</td>
          <td class="paramname"><em>fildes</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">struct <a class="el" href="group___fs_posix_api.html#gac21b705a5ebd42c4c46363250ab817bc">stat</a> *&#160;</td>
          <td class="paramname"><em>buf</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">
<p>this function is a POSIX compliant version, which will get file status.</p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">fildes</td><td>the file description </td></tr>
    <tr><td class="paramname">buf</td><td>the data buffer to save stat description. </td></tr>
  </table>
  </dd>
</dl>

</div>
</div>
<a class="anchor" id="gae7af18cc5fa39f42a3be1bf1eb24119d"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">int statfs </td>
          <td>(</td>
          <td class="paramtype">const char *&#160;</td>
          <td class="paramname"><em>path</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">struct statfs *&#160;</td>
          <td class="paramname"><em>buf</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">
<p>this function is a POSIX compliant version, which will return the information about a mounted file system.</p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">path</td><td>the path which mounted file system. </td></tr>
    <tr><td class="paramname">buf</td><td>the buffer to save the returned information.</td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>0 on successful, others on failed. </dd></dl>

</div>
</div>
<a class="anchor" id="ga548e5b744ca2e97beb61ad7aa41114e2"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">int mkdir </td>
          <td>(</td>
          <td class="paramtype">const char *&#160;</td>
          <td class="paramname"><em>path</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">mode_t&#160;</td>
          <td class="paramname"><em>mode</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">
<p>this function is a POSIX compliant version, which will make a directory</p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">path</td><td>the directory path to be made. </td></tr>
    <tr><td class="paramname">mode</td><td></td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>0 on successful, others on failed. </dd></dl>

</div>
</div>
<a class="anchor" id="ga570282ae7ba596263ec812b368d99b34"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">int rmdir </td>
          <td>(</td>
          <td class="paramtype">const char *&#160;</td>
          <td class="paramname"><em>pathname</em></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div><div class="memdoc">
<p>this function is a POSIX compliant version, which will remove a directory.</p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">pathname</td><td>the path name to be removed.</td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>0 on successful, others on failed. </dd></dl>

</div>
</div>
<a class="anchor" id="ga1632d8c06c14f295c6d9407b7fec67af"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">DIR* opendir </td>
          <td>(</td>
          <td class="paramtype">const char *&#160;</td>
          <td class="paramname"><em>name</em></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div><div class="memdoc">
<p>this function is a POSIX compliant version, which will open a directory.</p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">name</td><td>the path name to be open.</td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>the DIR pointer of directory, NULL on open failed. </dd></dl>

</div>
</div>
<a class="anchor" id="gaa7687571d2af8efd5153874ae6e678d9"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">struct dirent* readdir </td>
          <td>(</td>
          <td class="paramtype">DIR *&#160;</td>
          <td class="paramname"><em>d</em></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div><div class="memdoc">
<p>this function is a POSIX compliant version, which will return a pointer to a dirent structure representing the next directory entry in the directory stream.</p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">d</td><td>the directory stream pointer.</td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>the next directory entry, NULL on the end of directory or failed. </dd></dl>

</div>
</div>
<a class="anchor" id="gaaf08168ca632ba3f9385aa53261ae63d"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">long telldir </td>
          <td>(</td>
          <td class="paramtype">DIR *&#160;</td>
          <td class="paramname"><em>d</em></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div><div class="memdoc">
<p>this function is a POSIX compliant version, which will return current location in directory stream.</p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">d</td><td>the directory stream pointer.</td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>the current location in directory stream. </dd></dl>

</div>
</div>
<a class="anchor" id="ga58829cca160034015b3dddc17bb502ab"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">void seekdir </td>
          <td>(</td>
          <td class="paramtype">DIR *&#160;</td>
          <td class="paramname"><em>d</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">off_t&#160;</td>
          <td class="paramname"><em>offset</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">
<p>this function is a POSIX compliant version, which will set position of next directory structure in the directory stream.</p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">d</td><td>the directory stream. </td></tr>
    <tr><td class="paramname">offset</td><td>the offset in directory stream. </td></tr>
  </table>
  </dd>
</dl>

</div>
</div>
<a class="anchor" id="ga08e6a89050229d246d07d9e17d57cb29"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">void rewinddir </td>
          <td>(</td>
          <td class="paramtype">DIR *&#160;</td>
          <td class="paramname"><em>d</em></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div><div class="memdoc">
<p>this function is a POSIX compliant version, which will reset directory stream.</p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">d</td><td>the directory stream. </td></tr>
  </table>
  </dd>
</dl>

</div>
</div>
<a class="anchor" id="ga058e669d865116ec6419ea3a52207830"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">int closedir </td>
          <td>(</td>
          <td class="paramtype">DIR *&#160;</td>
          <td class="paramname"><em>d</em></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div><div class="memdoc">
<p>this function is a POSIX compliant version, which will close a directory stream.</p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">d</td><td>the directory stream.</td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>0 on successful, -1 on failed. </dd></dl>

</div>
</div>
<a class="anchor" id="ga3284211bd28346254245c9d4fd071d7f"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">char* getcwd </td>
          <td>(</td>
          <td class="paramtype">char *&#160;</td>
          <td class="paramname"><em>buf</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">size_t&#160;</td>
          <td class="paramname"><em>size</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">
<p>this function is a POSIX compliant version, which will return current working directory.</p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">buf</td><td>the returned current directory. </td></tr>
    <tr><td class="paramname">size</td><td>the buffer size.</td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>the returned current directory. </dd></dl>

</div>
</div>
</div><!-- contents -->
</div><!-- doc-content -->
<!-- start footer part -->
<div id="nav-path" class="navpath"><!-- id is needed for treeview function! -->
  <ul>
    <li class="footer">Generated on Mon Jan 6 2014 23:05:02 for RT-Thread RTOS by
    <a href="http://www.doxygen.org/index.html">
    <img class="footer" src="doxygen.png" alt="doxygen"/></a> 1.8.5 </li>
  </ul>
</div>
</body>
</html>
